package com.ysd.Controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ysd.Service.DepartmentService;
import com.ysd.entity.Department;

@RequestMapping("/department")
@RestController
@CrossOrigin
public class DepartmentController {
	@Autowired
	private DepartmentService departmentService;
	@GetMapping
	public List<Department> getAll(){
		return departmentService.getAll();
		
	}
}
